package com.wyg.epdata.util;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang.StringUtils;

/**
 * @Author: WangYongGan
 * @Date: 2021/12/17 19:44
 * @Description:
 */
public class JsonUtil extends JSONObject {
    public void putOrNull(String key, String value, String or) {
        if (StringUtils.isBlank(value))
            put(key, or);
        else
            put(key, value);
    }

    public void putOrNullZh(String key, String value) {
        putOrNull(key, value, "暂无");
    }

    public void putOrNullEn(String key, String value) {
        putOrNull(key, value, "null");
    }
}
